package com.xcw.entity.contanst;


/**
 * @author yejunjie
 * @description: 参数校验正则合集
 * @date: 2022/5/26 14:47
 */
public class FormatConstant {


    //验证用户名
    public final static String USER_NAME = "^[a-zA-Z0-9_-]{4,16}$";
    //验证密码
    public final static String USER_PWD = "^[a-z0-9_-]{6,16}$";
    //验证手机
    public final static String MOBILE = "^((13[0-9])|(15[^4,\\D])|(17[^4,\\D])|(18[0,5-9]))\\d{8}$";
    //验证邮箱
    public final static String EMAIL = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
    //验证MD5
    public final static String MD5 = "[A-Za-z0-9_]{16,40}";
    //验证日期，yyyy-MM-dd
    public final static String DATE = "[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}";
    //验证时间，yyyy-MM-dd HH:MM:SS
    public final static String DATETIME = "^\\d{4}\\D+\\d{1,2}\\D+\\d{1,2}\\D+\\d{1,2}\\D+\\d{1,2}\\D+\\d{1,2}\\D*";
    //验证整数
    public final static String NUMBER = "^-?[0-9]\\d*$";
    //正整数
    public final static String POSITIVE_NUMBER = "^[0-9]*[1-9][0-9]*$";
    //验证中文
    public final static String CHINESE = "^[\u4e00-\u9fa5]+$";
    //验证字母
    public final static String LETTER = "^[a-zA-Z]+$";
    //中文字母数字下划线横杠
    public final static String CHINESE_ALPHANUMERIC_UNDERLINE_RUNG = "^[a-zA-Z0-9_\\u4e00-\\u9fa5]+$";
    //字母数字
    public final static String AN_ALPHANUMERIC = "^[a-zA-Z0-9]+$";
    //字母数字下划线
    public final static String ALPHANUMERIC_UNDERLINE = "^[a-zA-Z0-9_]+$";
    //字母中文
    public final static String ALPHABET_CHINESE = "^[a-zA-Z\\u4e00-\\u9fa5]+$";
    //mysql数据库表名字段名校验
    public final static String MYSQL_CHECK = "^[\\w-]*\\.?[\\w]*\\.??$";
    //业务场景管理最多只能有5层
    public final static String PARENT_IDS_CHECK = "^(\\d+/){1,3}$";
}
